TOOLPATH			= ../tools/
LIBPATH				= ../lib/

DEL					= del 

CC					= $(TOOLPATH)cc1.exe
AS					= $(TOOLPATH)as.exe
LD					= $(TOOLPATH)ld.exe
MAKE				= $(TOOLPATH)mingw32-make.exe

LIBS				= $(LIBPATH)libuser32.a $(LIBPATH)libgdi32.a $(LIBPATH)libkernel32.a

win32.exe: win32.o
	$(LD) -o win32.exe -Map win32.map win32.o $(LIBS)

%.o: %.s
	$(AS) $*.s -o $*.o

%.s: %.c
	$(CC) $*.c -o $*.s

clean:
	$(DEL) *.o
	$(DEL) *.s
	$(DEL) *.map

src_only:
	$(MAKE) clean
	$(DEL) *.exe
